import { useState, useEffect } from 'react' import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "/components/ui/card" import { Button } from "/components/ui/button" import { Input } from "/components/ui/input" import { Label } from "/components/ui/label" import { Search, BookOpen, Users, Lightbulb, Sparkles, Clock, MapPin, Heart, Moon, Sun } from 'lucide-react' interface StudyContent { verse: string verseText: string nkjvReference: string explanation: { overview: string keyThemes: string[] theologicalSignificance: string crossReferences: string[] } historicalContext: { period: string author: string audience: string culturalBackground: string historicalEvents: string[] } application: { dailyLife: string[] relationships: string[] spiritualGrowth: string[] communityImpact: string[] prayerPoints: string[] } } // NKJV Bible verses database (sample) const nkjvVerses: Record = { "romans 8:28": { text: "And we know that all things work together for good to those who love God, to those who are the called according to His purpose.", reference: "Romans 8:28 (NKJV)" }, "john 3:16": { text: "For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life.", reference: "John 3:16 (NKJV)" }, "psalm 23:1": { text: "The Lord is my shepherd; I shall not want.", reference: "Psalm 23:1 (NKJV)" }, "jeremiah 29:11": { text: "For I know the thoughts that I think toward you, says the Lord, thoughts of peace and not of evil, to give you a future and a hope.", reference: "Jeremiah 29:11 (NKJV)" }, "philippians 4:13": { text: "I can do all things through Christ who strengthens me.", reference: "Philippians 4:13 (NKJV)" } } export default function BibleStudyApp() { const [verseInput, setVerseInput] = useState('') const [studyContent, setStudyContent] = useState(null) const [isLoading, setIsLoading] = useState(false) const [error, setError] = useState('') const [darkMode, setDarkMode] = useState(false) useEffect(() => { if (darkMode) { document.documentElement.classList.add('dark') } else { document.documentElement.classList.remove('dark') } }, [darkMode]) const getNKJVText = (input: string): { text: string; reference: string } => { const normalized = input.toLowerCase().trim() if (nkjvVerses[normalized]) { return nkjvVerses[normalized] } for (const [key, value] of Object.entries(nkjvVerses)) { if (normalized.includes(key) || key.includes(normalized)) { return value } } return { text: "And we know that all things work together for good to those who love God, to those who are the called according to His purpose.", reference: "Romans 8:28 (NKJV)" } } const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() if (!verseInput.trim()) { setError('Please enter a Bible verse') return } setIsLoading(true) setError('') const nkjvData = getNKJVText(verseInput) setTimeout(() => { setStudyContent({ verse: verseInput, verseText: nkjvData.text, nkjvReference: nkjvData.reference, explanation: { overview: "This powerful verse from Romans 8 reveals God's sovereign purpose in the lives of believers. The phrase 'we know' indicates this is established truth, not speculation. The scope 'all things' is comprehensive - nothing is excluded from God's redemptive work.", keyThemes: [ "God's Sovereignty - He actively works in every circumstance", "Divine Purpose - Nothing happens without reason in God's plan", "Unconditional Love - The promise is for 'those who love Him'", "Calling and Election - Believers are 'called according to His purpose'" ], theologicalSignificance: "This verse bridges the gap between God's providence and human suffering. It doesn't promise that all things are good, but that God works through all things for ultimate good. This reflects the biblical pattern of redemptive suffering seen in Joseph, Job, and ultimately Christ.", crossReferences: ["Genesis 50:20 (NKJV)", "Jeremiah 29:11 (NKJV)", "Ephesians 1:11 (NKJV)", "Philippians 1:6 (NKJV)"] }, historicalContext: { period: "AD 57, during Paul's third missionary journey", author: "Apostle Paul", audience: "Christian community in Rome - a diverse church of Jews and Gentiles", culturalBackground: "Rome was the center of the Roman Empire, where Christians faced increasing persecution under Nero. The church was struggling with questions about God's faithfulness amid suffering and social pressure to conform to Roman paganism.", historicalEvents: [ "Recent expulsion of Jews from Rome by Claudius (AD 49)", "Growing persecution under Emperor Nero", "Tension between Jewish and Gentile believers", "Economic hardships and social ostracization" ] }, application: { dailyLife: [ "When facing setbacks at work, remember God is developing character and opening new opportunities", "In financial difficulties, trust that God is teaching dependence and eternal values", "During health challenges, see God's refining work and eternal perspective", "When plans fail, seek God's greater purpose rather than your own agenda" ], relationships: [ "Forgive others knowing God can bring good even from hurtful situations", "View difficult relationships as opportunities for Christlike character development", "Trust God to work in estranged family relationships for eventual reconciliation", "Use conflicts as chances to demonstrate supernatural peace and love" ], spiritualGrowth: [ "Keep a gratitude journal documenting how God worked through past difficulties", "Memorize this verse for times of trial and uncertainty", "Practice surrendering daily frustrations to God's sovereign plan", "Develop eyes to see God's hand in both blessings and trials" ], communityImpact: [ "Share testimonies of God's redemptive work in past struggles", "Support others going through trials with hope-filled perspective", "Create support groups that focus on God's purposes in suffering", "Serve in ministries that bring good from difficult circumstances" ], prayerPoints: [ "Thank God for specific ways He has worked good through past difficulties", "Ask for eyes to see His purposes in current challenges", "Pray for others who are struggling to grasp this truth", "Request grace to trust God's timing and methods" ] } }) setIsLoading(false) }, 1500) } return (
{/* Header with Dark Mode Toggle */}

Bible Study Companion

Deepen your understanding with comprehensive insights

{/* Verse Input Form */} Enter a Bible Verse Type a verse reference (e.g., John 3:16, Psalm 23:1, Romans 8:28)
setVerseInput(e.target.value)} className={`mt-1 ${darkMode ? 'bg-gray-700 border-gray-600 text-white placeholder-gray-400 focus:border-teal-400 focus:ring-teal-400' : 'border-indigo-200 focus:border-indigo-400 focus:ring-indigo-400' }`} />

Available verses: Romans 8:28, John 3:16, Psalm 23:1, Jeremiah 29:11, Philippians 4:13

{error && (

{error}

)}
{/* Study Results */} {studyContent && (
{/* Display Verse - TEAL/CYAN THEME */} "{studyContent.verseText}"

{studyContent.nkjvReference}

{/* Explanation */} Deep Explanation & Theological Insights

NKJV Translation Notes

The NKJV renders this verse with "work together for good" which emphasizes the synergistic nature of God's providence - all circumstances cooperate under divine sovereignty for the believer's ultimate benefit.

Overview

{studyContent.explanation.overview}

Key Themes

    {studyContent.explanation.keyThemes.map((theme, index) => (
  • {theme}
  • ))}
{/* Historical Context - CHANGED TITLE TO WHITE */}
Historical & Cultural Context
{studyContent.historicalContext.period} {studyContent.historicalContext.author}

Original Audience

{studyContent.historicalContext.audience}

Cultural Background

{studyContent.historicalContext.culturalBackground}

Historical Events

    {studyContent.historicalContext.historicalEvents.map((event, index) => (
  • {event}
  • ))}
{/* Application */} Life Application Guide
{Object.entries(studyContent.application).map(([category, items]) => (

{category.charAt(0).toUpperCase() + category.slice(1).replace(/([A-Z])/g, ' $1')}

    {items.map((item: string, index: number) => (
  • {item}
  • ))}
))}
)} {/* Loading State */} {isLoading && (

Loading study materials...

)} {/* Welcome Message */} {!studyContent && !isLoading && (

Enter a Bible verse above to begin your study journey

Results will be displayed in NKJV translation

)}
) }